<?php 

if ($this->Session->read('Auth.User')){

				
	echo '<h1>Menu Principal</h1>';
	echo '<p>';
	echo '<ul>';


	if($this->Permission->check('ServiceOrders.view')){  
		echo '<li>'. $this->Html->link('Ordenes de Servicio', array('controller' => 'ServiceOrders')) . '</li>';  
	}

	if($this->Permission->check('ServiceOrderRows.index')){ 
		echo '<li>'. $this->Html->link('Cubiertas', array(
			'controller' => 'ServiceOrderRows',
			'action' => 'index', 
			$this->Session->read('Auth.User.Group.state_id'))) . '</li>'; 
	}

	if($this->Permission->check('Users.view')){  
		echo '<li>Usuarios<ul>';
		echo '<li>'. $this->Html->link('Usuarios', array('controller' => 'Users')) . '</li>';  
		echo '<li>'. $this->Html->link('Grupos', array('controller' => 'Groups')) . '</li>';  
		echo '</ul></li>';
	}

	if($this->Permission->check('Clients.view')){  
		echo '<li>'. $this->Html->link('Clientes', array('controller' => 'Clients')) . '</li>';  
	}
	 
	if($this->Permission->check('Sellers.view')){
		echo '<li>'. $this->Html->link('Vendedores', array('controller' => 'Sellers')) . '</li>'; 
	}

	echo '</ul>';

	
	echo '</p>';
 }
else{
	echo 'No esta autentificado';
	echo $this->Html->link('  Ingresar', array('controller' => 'Users', 'action' => 'login'), array('class' => 'glyphicon glyphicon glyphicon-log-in btn btn-primary btn-lg'));

}

?>